var webpack = require('webpack');
var path = require('path');

module.exports = {
  context: __dirname + '/src',
  entry: "./js/index.js",
  module: {
    rules: [
      {
        test: /\.js?$/,
        exclude: /(node_modules)/,
        loader: 'babel-loader',
        query: {
          presets: ['react', 'es2015','stage-0']
        }
      },{
        test: /\.css$/,
        loader: 'style-loader!css-loader'
      },
    ]
  },
  output: {
    path: __dirname + "/src/",
    filename: "bundle.js"
  },

  devServer: {
  //contentBase: "./src", //本地服务器所加载的页面所在的目录
      historyApiFallback: true, //不跳转
      inline: true  //实时刷新
  },
    mode: 'development'
}
